Caption = "The RGB valuesfor the above color are:"
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
Height = 225
Left = 420
TabIndex = 35
Top = 3300
Width = 3360
End
Begin VB.Label lblVB
Caption = "&&H"
BeginProperty Font
Name = "Courier New"
Size = 15.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 2520
TabIndex = 34
Top = 2730
Width = 1755
End
Begin VB.Label lblHTML
Caption = """ """
BeginProperty Font
Name = "Courier New"
Size = 15.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 2520
TabIndex = 33
Top = 2190
Width = 1755
End
Begin VB.Label lblG
Caption = "G"
BeginProperty Font
Name = "Arial"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 1860
TabIndex = 32
Top = 3600
Width = 225
End
Begin VB.Label lblB
Caption = "B"
BeginProperty Font
Name = "Arial"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 3000
TabIndex = 31
Top = 3600
Width = 195
End
Begin VB.Label lblR
Caption = "R"
BeginProperty Font
Name = "Arial"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 720
TabIndex = 30
Top = 3600
Width = 210
End
Begin VB.Label lblV
Alignment = 1 'Right Justify
Caption = "The VB hex code for the above color is:"
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 360
TabIndex = 13
Top = 2640
Width = 2055
End
Begin VB.Label lblHT
Alignment = 1 'Right Justify
Caption = "The HTML hex code for the above color is:"
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 420
TabIndex = 12
Top = 2100
Width = 1995
End
Attribute VB_Name = "frmColorRef"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim sColor As SelectedColor
Dim iHpos As Integer, iVpos As Integer
Dim blnUpdate As Boolean, blnHue As Boolean, blnSat As Boolean, blnLum As Boolean, blnBuddy As Boolean
'APIs for color-sampling routines
Private Type POINTAPI
x As Long
y As Long
End Type
Private Type RGBType
R As Byte
G As Byte
B As Byte
Filler As Byte
End Type
Private Type RGBLongType
clr As Long
End Type
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long
Private Declare Function ScreenToClient Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long
Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Sub cmd5by5_Click()
'Start a 5x5 average sample
Dim lReturn As Long
lReturn = SetCapture(picColor.hwnd)
tmr5by5.Interval = 100
pic5x5.Visible = True
End Sub
Private Sub cmdChange_Click()
'Call common color dialog (no .dll)
'This routine by Paul Mather, with minor modifications